<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// 
//  likelist.php
//  phpweb
//  
//  Created by WillLee on 2011-07-06.
//  Copyright 2011 lishuzu. All rights reserved.
// 


class Likelist extends CI_Controller {

	function __construct()
	{
		parent::__construct();
		
 		$this->load->model('common/security_model');
		if($this->security_model->isLogin() === FALSE){
			showmessage('请登录', 'login', 2);
		}
		$this->load->model('user_model');
		//关系模块
		$this->load->model('ship_model');
		$this->load->model('likelist_model');
		
		$this->user = $this->session->userdata('user') ? $this->session->userdata('user') : '';
		$this->uid = $this->uri->segment(3) ? intval($this->uri->segment(3)) : $this->user['uid'];

	}
	
	public function index()
	{
		$data['userinfo'] = $this->user_model->get_user_smart($this->uid);
		$data['self'] = $this->security_model->checkself($this->uid);
		if (!$data['self']) {
			$data['shipcode'] = $this->ship_model->get_ship($this->uid);
			$data['shipword'] = $this->ship_model->get_ship_word($data['shipcode']);
		}
		
		$data['likelist'] = $this->likelist_model->get_likes();
		$this->load->template('likelist_tpl', $data);
	}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */